home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4845 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.microsoft.com!news
  2. From: jparker@wolfenet.com (J Parker)
  3. Newsgroups: comp.lang.c
  4. Subject: Help: need to read a file name from a file and pass to func. to open another file
  5. Date: 7 Feb 1996 08:35:48 GMT
  6. Organization: Microsoft Corporation
  7. Message-ID: <4f9o94$s5v@news.microsoft.com>
  8. NNTP-Posting-Host: 157.54.18.88
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.93.14
  11.  
  12. Need help:
  13.  
  14. I know what your thinking but I'm really an operator not a developer, and 
  15. I work grave so no around here at the time programs anything but maybe 
  16. VB (uhgg..  ;-) ).
  17.  
  18. I'm trying to read a file full of file names, extract each name, pass one 
  19. name at a time to a function which opens the file and extracts info.  
  20. Both files are ascii.  In the first part, I read the file and put the 
  21. file names into a 2 dimension character array.  I then call the function, 
  22. passing one row at a time in a loop till all the files have been read.  
  23.  
  24. The problem is that when I pass what has now effectively become a char 
  25. string to the function, fopen() blows chunks on the "\0" character that C 
  26. places at the endof all char strings.  (I've deduced this from debugging 
  27. code placed in the source, I may be way off here, comments ...)
  28.  
  29. I've tried every way I can come up with to strip off the "\0" from the 
  30. end of the string, plus every reference in every manual I own... Nothing 
  31. seems to work.  Any comments, suggestions, code fragments are greatly 
  32. appreciated.
  33.  
  34. Would appreciate mail,since it's hard to keep caught up on the news 
  35. groups.  Also if you need to see my source please mail.
  36.  
  37. Thanks in advance
  38. a-herbp@microsoft.com
  39. jparker@wolfent.com  
  40. -- 
  41. The opinions expressed in this message are my own personal views 
  42. and do not reflect the official views of Microsoft Corporation.
  43.  
  44.